package com.ubao.activity;

import java.util.Timer;
import java.util.TimerTask;

import com.ubao.R;
import com.ubao.base.BaseActivity;
import com.ubao.util.Util;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.format.Time;

public class WelcomeActivity extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ui_welcome);
		MyApp.isLogin = getLoginStatus(Util.getFromSP(this, Util.APPINFO, Util.LOGIN));
		timer.schedule(tt, 1000);
	}
	
	private boolean getLoginStatus(String fromSP) {
		if(fromSP!=null&&fromSP.equals("true")){
			return true;
		}
		return false;
	}

	Timer timer = new Timer();
	TimerTask tt = new TimerTask() {
		
		@Override
		public void run() {
			Intent intent = new Intent();
			if(MyApp.isLogin){
				intent.setClass(WelcomeActivity.this, MainActivity.class);
			}else{
				intent.setClass(WelcomeActivity.this, LoginActivity.class);
			}
			startActivity(intent);
			finish();
		}
	};
	@Override
	protected void initView() {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void getIntentData() {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void setIntentData() {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void startLocate() {
	}

	@Override
	protected void stopLocate() {
	}
	
	
	
	//<com.mapabc.mapapi.MapView android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/mapViewId" android:layout_above="@+id/rlDetail" android:layout_below="@+id/rlTitle" android:apiKey="06SkET4ZEJGULRieUWcPLV4bmyCf2XXpw9zcLnQ" android:clickable="true" android:enabled="true"/>
	//06SkET4ZEJGULRieUWcPLV4bmyCf2XXpw9zcLnQ
}
